using System;
using System.Collections.Generic;
using System.Text;

namespace Pixysoft.Office
{
    public class WordTableFormat
    {
        float width = -1f;
        float height = 20f;
        System.Drawing.Font font = new System.Drawing.Font("Times New Roman", 10.5f);
        System.Drawing.ContentAlignment textAlign = System.Drawing.ContentAlignment.MiddleCenter;
        System.Drawing.ContentAlignment tableAlign = System.Drawing.ContentAlignment.MiddleLeft;
        WordTableBoarderStyle boarderStyle = WordTableBoarderStyle.None;

        public float Height
        {
            get { return height; }
            set { height = value; }
        }

        public float Width
        {
            get { return width; }
            set { width = value; }
        }
        public System.Drawing.Font Font
        {
            get { return font; }
            set { font = value; }
        }
        public System.Drawing.ContentAlignment TextAlign
        {
            get { return textAlign; }
            set { textAlign = value; }
        }
        public System.Drawing.ContentAlignment TableAlign
        {
            get { return tableAlign; }
            set { tableAlign = value; }
        }
        public WordTableBoarderStyle BoarderStyle
        {
            get { return boarderStyle; }
            set { boarderStyle = value; }
        }

        public WordTableFormat()
        {
        }
        public WordTableFormat(float width, float height)
        {
            InitWordTableFormat(width, height, null, System.Drawing.ContentAlignment.MiddleLeft, System.Drawing.ContentAlignment.MiddleLeft, WordTableBoarderStyle.None);
        }
        public WordTableFormat(float width, float height, System.Drawing.Font font)
        {
            InitWordTableFormat(width, height, font, System.Drawing.ContentAlignment.MiddleLeft, System.Drawing.ContentAlignment.MiddleLeft, WordTableBoarderStyle.None);
        }
        public WordTableFormat(float width, float height, System.Drawing.Font font, System.Drawing.ContentAlignment textAlign)
        {
            InitWordTableFormat(width, height, font, textAlign, System.Drawing.ContentAlignment.MiddleLeft, WordTableBoarderStyle.None);
        }
        public WordTableFormat(float width, float height, System.Drawing.Font font, System.Drawing.ContentAlignment textAlign, System.Drawing.ContentAlignment tableAlign)
        {
            InitWordTableFormat(width, height, font, textAlign, tableAlign, WordTableBoarderStyle.None);
        }
        public WordTableFormat(float width, float height, System.Drawing.Font font, System.Drawing.ContentAlignment textAlign, System.Drawing.ContentAlignment tableAlign, WordTableBoarderStyle style)
        {
            InitWordTableFormat(width, height, font, textAlign, tableAlign, style);
        }
        private void InitWordTableFormat(float width, float height, System.Drawing.Font font,
            System.Drawing.ContentAlignment textAlign, System.Drawing.ContentAlignment tableAlign,
            WordTableBoarderStyle borderStyle)
        {
            if (width >= 0)
                Width = width;
            if (height > 0)
                this.Height = height;
            if (font != null)
                Font = font;
            TextAlign = textAlign;
            TableAlign = tableAlign;
            this.BoarderStyle = borderStyle;
        }
    }

    public enum WordTableBoarderStyle
    {
        None = 1,
        Line = 2,
        Dot = 3
    }

}
